{% extends '../base.html' %}
{% block title %}主页{% endblock %}
{% block content %}
    {% if request.session.is_login %}
<div class="container-lg mb-5 pt-4" >
<!--     <section>-->
<!--     <ul class="nav nav-pills">-->
<!--      <li role="presentation" ><a href="http://127.0.0.1:8000/blog/index">首页</a></li>-->
<!--      <li role="presentation" class="active"><a href="http://127.0.0.1:8000/blog/list">详情</a></li>-->
<!--      <li role="presentation"><a href="http://127.0.0.1:8000/map/index">展示</a></li>-->
<!--      <li role="presentation"><a href="http://localhost:8999/#/screen">数据大屏</a></li>-->
<!--    </ul>-->
<!--    </section>-->
<div class="row" >
  <div class="col-lg-6">
    <div class="input-group" >
      <input type="text" class="form-control" placeholder="Search for...">
      <span class="input-group-btn" >
        <button class="btn btn-default" type="button"  >搜索 </button>
      </span>
    </div><!-- /input-group -->
  </div><!-- /.col-lg-6 -->
</div><!-- /.row -->

</div>
    <div table-responsive>
<table class="table table-hover" style="table-layout:auto;white-space:nowrap;overflow:hidden;">

    <tr>
         <th>名称</th>
         <th>类型</th>
         <th>原产地</th>
         <th>时间</th>
   </tr>
{% for collect in collect_list %}

    <tr>
        <td><a href="/blog/detail/{{collect.id}}">{{collect.name}}</a></td>
    <td>{{collect.type}}</td>
<!--    <td>{{collect.location}}</td>-->
    <td>{{collect.province}}{{collect.city}}</td>
    <td>{{collect.publish_date}}</td>
    </tr>
{% endfor %}

<!--<td>{{collect.name}}</td>-->
<!--<td>{{collect.name}}</td>-->

</table>
    </div>

</div>
<div>
<nav aria-label="...">
  <ul class="pager">
    <li><a href="/detail/{{previous_collect.id}}">上一页:{{previous_collect.name}}</a></li>
    <li><a href="/detail/{{next_collect.id}}">下一页:{{next_collect.name}}</a></li>
    <li><a href="/index/">首页</a></li>
  </ul>
</nav>
</div>

</div>
    {% else %}
    <h1>你尚未登录，只能访问公开内容！</h1>
    {% endif %}
{% endblock %}